home *** CD-ROM | disk | FTP | other *** search
- package Code.FIELD.effects
- {
- import Code.LIB._be548;
- import Code.LIB._rs402;
- import flash.filters.DropShadowFilter;
- import flash.filters.GlowFilter;
- import flash.geom.Point;
-
- public class _vn252 extends _be548
- {
- public static const stGlow:int = 0;
-
- public static const stAddStars:int = 1;
-
- public static const stStarsFly:int = 2;
-
- public static const stInvisible:int = 3;
-
- private var starsC:_be548;
-
- private var glowFilterOuter:GlowFilter;
-
- private var timer:int = 0;
-
- private var stars:Array;
-
- private var _state:int;
-
- private var movingStars:Array;
-
- private var glowColor:int;
-
- private var cellSide:Number;
-
- public function _vn252(param1:Array, param2:Number, param3:int)
- {
- timer = 0;
- super();
- cellSide = param2;
- stars = param1;
- glowColor = param3;
- state = stGlow;
- this.graphics.beginFill(255,0.01);
- this.graphics.drawCircle(0,0,1);
- this.graphics.endFill();
- }
-
- private function _he646() : void
- {
- var _loc1_:_fx371 = null;
- var _loc2_:Point = null;
- _loc1_ = new _fx371();
- _loc2_ = new Point(10 * Math.random() - 10 * Math.random(),-10 * Math.random() + 10 * Math.random());
- _loc2_.normalize(5 + Math.random() * 3);
- movingStars.push([_loc1_,_loc2_]);
- _loc1_.pictureInd = stars.length - 1 - int(Math.random() * (stars.length - 1) * 0.5);
- _loc1_._up144(stars[_loc1_.pictureInd]);
- _loc1_.step = 0;
- _loc1_._vq458 = cellSide * Math.random() * 0.8;
- _loc1_._vg471 = cellSide * Math.random() * 0.8;
- _loc1_.totalSteps = 12 + Math.random() * 4;
- starsC.addChild(_loc1_);
- }
-
- public function set state(param1:int) : void
- {
- var _loc2_:DropShadowFilter = null;
- var _loc3_:int = 0;
- var _loc4_:int = 0;
- _state = param1;
- switch(state)
- {
- case stGlow:
- glowFilterOuter = new GlowFilter(glowColor,1,cellSide * 0.2 * _rs402._oy577,cellSide * 0.2 * _rs402._oy577,2);
- _loc2_ = new DropShadowFilter(5,45,0,0.4);
- filters = [glowFilterOuter];
- state = stAddStars;
- break;
- case stAddStars:
- starsC = new _be548();
- movingStars = new Array();
- _loc3_ = 5 + Math.random() * 4;
- _loc4_ = 0;
- while(_loc4_ < _loc3_)
- {
- _he646();
- _loc4_++;
- }
- state = stStarsFly;
- addChild(starsC);
- timer = 0;
- }
- }
-
- public function get state() : int
- {
- return _state;
- }
-
- public function onEnterFrame() : void
- {
- var _loc1_:int = 0;
- switch(state)
- {
- case stGlow:
- break;
- case stStarsFly:
- _loc1_ = 0;
- while(_loc1_ < movingStars.length)
- {
- if(!_is22(_loc1_))
- {
- starsC.removeChild(movingStars[_loc1_][0]);
- movingStars.splice(_loc1_,1);
- _loc1_--;
- }
- _loc1_++;
- }
- if(movingStars.length == 0)
- {
- state = stInvisible;
- }
- }
- }
-
- private function _is22(param1:int) : Boolean
- {
- var _loc2_:_fx371 = null;
- var _loc3_:Point = null;
- _loc2_ = movingStars[param1][0];
- _loc3_ = movingStars[param1][1];
- _loc2_._vq458 += _loc3_.x;
- _loc2_._vg471 += _loc3_.y;
- ++_loc2_.step;
- if(++_loc2_.presc >= 2)
- {
- _loc2_.presc = 0;
- --_loc2_.pictureInd;
- if(_loc2_.pictureInd < 0)
- {
- return false;
- }
- _loc2_._up144(stars[_loc2_.pictureInd]);
- }
- return true;
- }
- }
- }
-
-